The present invention relates to a printer, a method of controlling the printer, and a storage medium.